﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
using System.Data;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //string url = "http://vnexpress.net/rss/tin-moi-nhat.rss";
        //XmlTextReader reader = new XmlTextReader(url);
        Service sv = new Service();
        DataSet ds = sv.GetNews();
        //ds.ReadXml(reader);

        for (int i = 0; i < ds.Tables["item"].Rows.Count ; i++)
        {
            ds.Tables["item"].Rows[i]["link"] = "DetailsRSS.aspx?url=" + Convert.ToString(ds.Tables["item"].Rows[i]["link"]);
            ds.Tables["item"].Rows[i]["description"] = ds.Tables["item"].Rows[i]["description"].ToString().Replace("href=\"","href=\"DetailsRSS.aspx?url=");
        }

        rptRSS.DataSource = ds.Tables["item"];
        rptRSS.DataBind();
    }
}
